import {base, axiosInstance} from '@/api/config';

//学校类型
const stSave = params => {
  return axiosInstance.post(`${base}/schoolType/save`, params);
}; //新增
const stList = params => {
  return axiosInstance.get(`${base}/schoolType/list`, {params: params});
}; //列表
const stDelete = params => {
  return axiosInstance.delete(`${base}/schoolType/delete`, {data: params});
};//删除
const stUpdate = params => {
  return axiosInstance.put(`${base}/schoolType/update`, params);
};//修改

//区域管理
const amSave = params => {
  return axiosInstance.post(`${base}/sysorg/save`, params);
}; //新增
const amList = params => {
  return axiosInstance.get(`${base}/schoolInfo/areaList`, {params: params});
}; //列表
const amDelete = params => {
  return axiosInstance.delete(`${base}/sysorg/delete`, {data: params});
};//删除
const amUpdate = params => {
  return axiosInstance.put(`${base}/sysorg/update`, params);
};//修改

//学校管理
const siSave = params => {
  return axiosInstance.post(`${base}/schoolInfo/save`, params);
}; //新增
const siList = params => {
  return axiosInstance.get(`${base}/schoolInfo/list`, {params: params});
}; //列表
const siDelete = params => {
  return axiosInstance.delete(`${base}/schoolInfo/delete`, {data: params});
};//删除
const siUpdate = params => {
  return axiosInstance.put(`${base}/schoolInfo/update`, params);
};//修改

//报名限制
const elImport = `${base}/blacklist/import`; //批量建档
const elSave = params => {
  return axiosInstance.post(`${base}/blacklist/save`, params);
}; //新增
const elList = params => {
  return axiosInstance.get(`${base}/blacklist/list`, {params: params});
}; //列表
const elDelete = params => {
  return axiosInstance.delete(`${base}/blacklist/delete`, {data: params});
};//删除
const elUpdate = params => {
  return axiosInstance.put(`${base}/blacklist/update`, params);
};//修改
const uExport = params => {
  return axiosInstance.get(`${base}//blacklist/export`, {responseType: 'blob', params: params});
};
const setAdmitTime = params => {
  return axiosInstance.put(`${base}/schoolInfo/setAdmitDate`, params)
}


const studentList = params => {
  return axiosInstance.get(`${base}/audit/selectStudent/${params}`);
}; //根据身份证号查询学生信息
const studentDelete = params => {
  return axiosInstance.delete(`${base}/audit/deleteStudent/${params}`);
};//删除

/*基本数据*/
let baseDatas = {

  //学校类型
  schooltype: {
    save: stSave,
    list: stList,
    delete: stDelete,
    update: stUpdate,
  },
  //区域管理
  areamanage: {
    save: amSave,
    list: amList,
    delete: amDelete,
    update: amUpdate,
  },

  //学校管理
  schoolmanege: {
    save: siSave,
    list: siList,
    delete: siDelete,
    update: siUpdate,
    setAdmitTime: setAdmitTime
  },

  //报名限制
  enlistlimit: {
    import: elImport,
    save: elSave,
    list: elList,
    delete: elDelete,
    update: elUpdate,
    export: uExport
  },
  deletestudent: {
    list:studentList,
    delete: studentDelete,
  },
};
export {baseDatas}
